Set Theory

Set Theory Basics

Set: A collection of distinct objects (elements).

Note: Implications of order not mattering in sets:

Set Notation

Braces (\{\}): Braces are used to indicate a set.

\in (belongs to): Used to show that an element belongs to a particular set.

Example: Using \in A = \{2,4,6,8,10\} \\ 3 \not \in A \land 2 \in A

Empty Set (\emptyset or \{\}): Set with no numbers.

Common Pitfall: Don’t accidentally use \{ \emptyset \} to represent an empty set, \{ \emptyset \} is a set containing an empty set!

Common Set Theory Notations:

Predicate Notation:

Example: A = \{ x | (\exists y) [(y \in \{ 0,1,2 \})] \land (x = y^2)\}

Example: B = \{ x | (\exists y)(\exists z) ( y \in \{ 1,2 \} \land z \in \{2,3\} \land x = z - y ) \}

Infinite Sets

Infinite Sets:

S = \{x | x \text{ is a positive even integer} \}

Examples: Two Ways to Describe Sets

Instructions: List the elements of each of the following sets.

Q: { x | x is a month with exactly thirty days }

Q: { x | x is an integer and 4 \lt x \lt t}


Instructions: What’s the predicate for each of the following sets?

Q: { 1, 4, 9, 16 }

Q: { 2,3,5,7,11,31,17, ...}

Open and Closed Interval

\text{Open Interval Example: }\\ \{ x \in \mathbb{R} | -2 < x < 3 \}

Relationships Between Sets

Subset (\subseteq)

For sets S and M, M is a subset of S if and only if every element in M is also an element of S.

Symbolic Representation:

Examples:

Proper Subset (\sub)

For sets S and M, if M \subseteq S and M \ne S, then there’s at least one element of S that’s not an element of M. In this case, M is a proper subset of S.

Symbolic Representation:

Example:

Superset (\supseteq)

Superset: If m is a subset of S, then S is a superset of m.

Symbolic Representation:

Proper Superset (\supset)

Proper Superset: If M is a proper subset of S, then S is a proper superset of M

Symbolic Representation:

Exercises: Reading Superset and Subset

Instructions: What statements are true?

Let:

Q: B \subseteq C

Q: A \subseteq C

Q: \{ 11,12,13 \} \subseteq A

Q: \{ 12 \} \in B

Q: \{ x | x \in N \land x <20 \} \not \subset B

Q: { \emptyset } \subset B

Q: \emptyset \subset B

Remember: Don’t get tripped-up by the empty set. You don’t need to surround it in brackets like “\{ 11 \} \subseteq A” because it’s already a set!

Cardinality

Cardinality: The number of elements within a set

Example: Simple | \{ 1,2,3 \} | < | \{ 1,2,3,4 \}

Example: Subset M \subseteq S \to | M | \le | S |

Example: Proper Superset A \supset B \to | A | > | B |

Note: Remember that \in and \subset behave differently!

Power Set (\wp)

Power Set: The power set of a set S is a set that contains all possible subsets of set S.

Example: S = \{ 1.2.3 \} \\~\\ \wp (S) = \{ \emptyset, \{1\}, \{2\}, \{3\}, \{1,2\}, \{1,3\}, \{2,3\}, \{1,2,3\} \}

Two ways to verify you have all the subsets written:

  1. Find all possible combinations of cardinality 0 and slowly increase cardinality until you have the full power set.
  2. Check cardinality of the finished power set: |P(S)| = 2^{|S|}

Common Pitfalls:

Operations on Sets

For the following definitions, let:

Union and Intersection

Union (\cup): Set that contains all elements in either A or B.

Note: The “or” in “A or B” is inclusive. That is, every element in A, B, or A and B is part of A \cup B.

Example: \text{Let } A = \{ 1,3,5,7,9\} \text{ and } B = \{ 3,7,9,10,15 \} \\~\\ \begin{aligned} A \cup B &= \{ 1,3,5,7,9,10,15 \} \\ \end{aligned}


Intersection (\cap): Set that contains all elements that are in both A and B.

Example: \text{Let } A = \{ 1,3,5,7,9\} \text{ and } B = \{ 3,7,9,10,15 \} \\~\\ \begin{aligned} A \cap B &= \{ 3,7,9 \} \end{aligned}

Disjoint, Complement, and Difference Sets

Disjoint Sets: If A \cap B = \emptyset, then A and B are disjoint sets.

Example: A = \{1,2,3\} \text{ and } B = \{ 4,5,6 \} \text{ are disjoint sets}


Complement Sets: For a set A \in P(U), the complement of set A—denoted as A'—is the set of all elements that aren’t in A.

Mathematical Definition: A' = \{ x | x \in U \land x \not \in A \}

Example: Let U = \{ 1,2,3,4,5,6 \} and A = \{ 1,2,3 \} A'=\{4,5,6\}


Difference Sets: The difference of A-B is the set of elements in A that aren’t in B.

Mathematical Definition: A - B = \{ x | x \in A \land x \not \in B \}

Example: Let A = \{ 1,2,3 \} and B = \{2,5\} A - B = \{1,3\}

Exercises: Operations on Sets

Let— A = \{1, 2, 3, 5, 10\} \\ B = \{2, 4, 7, 8, 9\} \\ C = \{5, 8, 10\}

—be subsets of S = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}.

Solve:

  1. Q: A \cup B
  2. Q: A - C
  3. Q: B' \cap ( A \cup C )
  4. Q: A \cup B \cap C

Cartesian Product

Cartesian Product: The Cartesian product of two sets is the set of all combinations of ordered pairs that can be produced from the elements of both sets.

Mathematical Definition:
If A and B are subsets of S, then: A \times B = \{ (x,y) | x \in A \land y \in B \}

Example: A = \{ 1,2,3 \} \\ B = \{ 2,3 \} \\~\\ A \times B = \{ (1,2),(1,3),(2,2),(2,3),(3,2),(3,3) \}

Note: Cardinality of cross product: |A| = n \\ |B| = m \\~\\ |A \times B | = nm

Note: Notation for a special case: A \times A = A^2

Pitfall: Cross product is not commutative: A \times B \ne B \times A